﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Common_CommonPartRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Common_CommonPartRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Common_CommonPartRecord() : base("Common_CommonPartRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _OwnerId = "OwnerId";
        public RaisingStudio.Data.Expressions.ColumnExpression OwnerId { get { return _OwnerId; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _CreatedUtc = "CreatedUtc";
        public RaisingStudio.Data.Expressions.ColumnExpression CreatedUtc { get { return _CreatedUtc; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _PublishedUtc = "PublishedUtc";
        public RaisingStudio.Data.Expressions.ColumnExpression PublishedUtc { get { return _PublishedUtc; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ModifiedUtc = "ModifiedUtc";
        public RaisingStudio.Data.Expressions.ColumnExpression ModifiedUtc { get { return _ModifiedUtc; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Container_id = "Container_id";
        public RaisingStudio.Data.Expressions.ColumnExpression Container_id { get { return _Container_id; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Common_CommonPartRecord Common_CommonPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Common_CommonPartRecord Common_CommonPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Common_CommonPartRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Common_CommonPartRecord Common_CommonPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Common_CommonPartRecord.Id,
                            Common_CommonPartRecord.OwnerId,
                            Common_CommonPartRecord.CreatedUtc,
                            Common_CommonPartRecord.PublishedUtc,
                            Common_CommonPartRecord.ModifiedUtc,
                            Common_CommonPartRecord.Container_id,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Common_CommonPartRecord>(_Common_CommonPartRecord Common_CommonPartRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Common_CommonPartRecord>(Common_CommonPartRecord);
        }


        #region IQueryExpression<_Common_CommonPartRecord> 成员

        _Common_CommonPartRecord RaisingStudio.Data.Expressions.IQueryExpression<_Common_CommonPartRecord>.Value
        {
            get { return Common_CommonPartRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Common_CommonPartRecord
    {
        #region Members
        public static readonly _Common_CommonPartRecord _ = new _Common_CommonPartRecord();
		#endregion
    }
}
